import request from "@/utils/request";

// 学生列表
type studentParamsType = {
    userName:string;
    role:number;
    pageIndex:number;
    pageSize:number;
}

export function StudentList(data:studentParamsType){
    return request.post('/api/admin/user/page/list', data)
}

// 添加
type AddParamsType = {
    id: null,
    userName: string,  //用户名
    password: string,  //密码
    realName: string,  //真实姓名
    role: number,  //角色
    status: number, //状态
    age: string, //年龄
    sex: string, //性别
    birthDay: null, //生日
    phone: null,  //手机号
    userLevel: number  //年级
}

export function add(data:AddParamsType){
    return request.post('/api/admin/user/edit', data)
}


// 删除
export function del(id:number){
    return request.post('/api/admin/user/delete/'+id)
}


//禁用 
export function  ChangeStatus(id:number){
    return request.post('/api/admin/user/changeStatus/'+id)
}

// 查询
export function  select(id:number){
    return request.post('/api/admin/user/select/'+id)
}